package org.zyzboole.base.encrypt.crypto.encryption;


import org.zyzboole.base.encrypt.crypto.enums.EncryptEnum;
import org.zyzboole.base.encrypt.util.spring.SpringUtils;

/**
 * 静态工厂
 *
 * @Author: zyz
 * @Date: 2022/2/14 15:20
 * @description
 */
public class EncryptFactory {


    /**
     * 获取加密方式
     *
     * @param encrypt
     * @return
     */
    public static EncryptDispose getDispose(EncryptEnum encrypt) {
        switch (encrypt) {
            case RSA:
                return SpringUtils.getBean(RSA.class);
            case MD5:
                return MD5.getInstance();
            default:
                return AES.getInstance();
        }
    }
}
